package com.lemon.core.base.pojo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import lombok.Data;

/**
 * 分页查询基类
 *
 * @author pan
 * @since 2017-03-05
 */
@ApiModel("分页参数")
@Data
public class BasePage {

    @ApiModelProperty(value = "页码，从 1 开始", required = true, example = "1")
    @NotNull(message = "页码不能为空")
    @Min(value = 1, message = "页码最小值为 1")
    private int page = 1;

    @ApiModelProperty(value = "每页记录数，最大值为 100", required = true, example = "10")
    @NotNull(message = "每页记录数不能为空")
    @Min(value = 1, message = "每页记录数最小值为 1")
    @Max(value = 100, message = "每页记录数最大值为 100")
    private int pageSize = 10;
}
